package org.cobaya.commons;

import java.util.HashMap;
import java.util.Map;

public abstract class Collect {

	public static <K, V> Map<K, V> map(Map<K, V> map, K key, V value) {
		Map<K, V> result=new HashMap<K, V>();
		if (map != null) {
			result.putAll(map);
		}
		result.put(key, value);
		return result;
	}

	public static Map<Object, Object> map(Object key, Object value) {
		return map(new HashMap<Object, Object>(), key, value);
	}
}